package org.lx.nursing.controller.member;

import io.swagger.annotations.Api;
import org.lx.common.core.controller.BaseController;
import org.lx.common.core.domain.AjaxResult;
import org.lx.common.core.page.TableDataInfo;

import org.lx.nursing.domain.NursingProject;
import org.lx.nursing.dto.OrderPageDto;
import org.lx.nursing.service.MemberOrdersProjectService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

import static org.lx.common.utils.PageUtils.startPage;

@RestController
@RequestMapping("/member/orders/project")
@Api(tags = "C端-项目订单相关接口")
public class MemberOrdersProjectController extends BaseController {

    @Resource
    private MemberOrdersProjectService memberOrdersProjectService;

    @GetMapping(value = "/page")
    public TableDataInfo<List<NursingProject>> getByPage(OrderPageDto orderPageDto){
        List<NursingProject> list = memberOrdersProjectService.getByPage(orderPageDto);
        return getDataTable(list);
    }

    //根据编号查询护理项目信息
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id){
        NursingProject nursingProject = memberOrdersProjectService.getById(id);
        return AjaxResult.success(nursingProject);
    }
}
